home *** CD-ROM | disk | FTP | other *** search
- //: C19:ExplicitInstantiation.cpp
- // From Thinking in C++, 2nd Edition
- // Available at http://www.BruceEckel.com
- // (c) Bruce Eckel 1999
- // Copyright notice in Copyright.txt
- #include "Urand.h"
- #include "Sorted.h"
- #include <iostream>
- using namespace std;
-
- // Explicit instantiation:
- template class Sorted<int>;
-
- int main() {
- Sorted<int> is;
- Urand<47> rand1;
- for(int k = 0; k < 15; k++)
- is.push_back(rand1());
- is.sort();
- for(int l = 0; l < is.size(); l++)
- cout << is[l] << endl;
- } ///:~
-